<?php
$this->sendDebugMessage("createTable model start");
$rid = $this->userCenter->userList[$ip]->roomID;

//创建游戏桌
$table = new Table();
$table->tableID = UUID::next();
$table->tableName = $data->para->tableName;
$seat=new Seat();
$seat->seatID = "1";
$seat->userID = $ip;
$table->seatList[$seat->seatID]=$seat;
$table->createrID=$ip;

//保存游戏桌信息
$this->userCenter->roomList[$rid]->createTable($table);

//游戏桌信息保存到user中
$this->userCenter->userList[$ip]->sitDown($seat,$table->tableID);
$seat->ready();
//向房主发送房间信息
$response = new Response();
$response->event = "SE_CREATE_DESK_SUCCESS";
$response->body = $table->getDetail();
$this->sendData($ip,$response , true );
//向房间内其他用户发送新建游戏桌信息
$response = new Response();
$response->event = "SE_INSERT_DESK";
$response->body = $table->getDetail();
$this->broadcastGroup($response,$this->userCenter->roomList[$rid]->getFreeUser());
$this->sendDebugMessage("createTable model end");
?>